package view

import (
	"html/template"
	"io"
	"luiz/crawler/fronted/model"
)

type SearchResultView struct {
	tem *template.Template
}

func CreateView(filename string) SearchResultView {
	return SearchResultView{
		tem: template.Must(template.ParseFiles(filename)),
	}
}
func (s SearchResultView) Render(w io.Writer, data model.SearchResult) error {
	return s.tem.Execute(w, data)
}
